// CarSimDisplayDlg.h : header file
//

#pragma once
#include "afxwin.h"
#include "afxcmn.h"


// CCarSimDisplayDlg dialog
class CCarSimDisplayDlg : public CDialog
{
	bool m_bPlaybackRunning;
// Construction
public:
	CCarSimDisplayDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_CARSIMDISPLAY_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	
public:
	afx_msg void OnBnClickedOk();
	afx_msg void OnBnClickedCancel();
	afx_msg void OnBnClickedButtonToDrawOn();

	afx_msg void OnTimer(UINT_PTR nIDEvent);

	inline int GetPlaybackTimer() const { return 1000; }

	class CarSimDrawButton : public CButton
	{
		// CDC * m_ghDC;
		RECT m_rect;
		bool m_bOglInitialized;
		PAINTSTRUCT m_ps;
		BOOL SetupPixelFormat();
		
	public:
		CarSimDrawButton() { m_bOglInitialized=false;}
		// virtual ~CarSimDrawButton() {}
		void DrawScreen();
		void DrawGlScene(void);
		HGLRC InitOglStuff();
	protected:
		afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
		afx_msg void OnPaint();
		DECLARE_MESSAGE_MAP()
	};
	CarSimDrawButton m_buttonToDrawOn;

	DECLARE_MESSAGE_MAP()
	CSliderCtrl m_sliderSteering;
	afx_msg void OnBnClickedButtonForwards();
	afx_msg void OnBnClickedButtonBackwards();
	CEdit m_textboxNumObstacles;
	CEdit m_textboxSidesPerObstacle;
	afx_msg void OnBnClickedButtonGenObstacles();
	CEdit m_textboxRadiusPerObstacle;
	afx_msg void OnBnClickedButtonRunBehavior();
	afx_msg void OnBnClickedButtonStopPlayback();
	CEdit m_editNumTrainingRuns;
	afx_msg void OnBnClickedButtonTrain();
	CEdit m_editEvalFreq;
	afx_msg void OnBnClickedButtonSaveNnet();
	afx_msg void OnBnClickedButtonLoadNnet();
	afx_msg void OnBnClickedButtonResetRobot();
	CEdit m_editLearningRate;
	CButton m_checkboxUseQlearning;
	CEdit m_editDiscountFactor;
	CEdit m_editMagicAnneal;
	CButton m_checkboxTrails;
};
